﻿''' <summary>
''' 报表中的一个打印元素，包含文字 对齐方式 宽度 高度 字体等
''' </summary>
Public Class ReportTextBoxPrintElement

    '文字部分
    Private m_TextContent As String
    '文字对齐方式
    Private m_TextAlign As ContentAlignment
    '绘制矩形大小
    Private m_TextRectangle As Rectangle
    '绘制使用的字体
    Private m_TextFont As Font

#Region "打印元素初始化"

    Public Sub New()

        '默认是矩形居中对齐
        m_TextAlign = ContentAlignment.MiddleCenter
        '默认是宋体8号字
        m_TextFont = New Font("宋体", 8, FontStyle.Regular)

    End Sub

    Public Sub New(ByVal s As String, ByVal a As ContentAlignment, ByVal rect As Rectangle, ByVal f As Font)
        m_TextContent = s
        m_TextAlign = a
        m_TextRectangle = rect
        m_TextFont = f
    End Sub

#End Region


#Region "打印元素属性"

    Public Property TextContent As String
        Get
            Return m_TextContent
        End Get
        Set(value As String)
            m_TextContent = value
        End Set
    End Property

    Public Property TextAlign As ContentAlignment
        Get
            Return m_TextAlign
        End Get
        Set(value As ContentAlignment)
            m_TextAlign = value
        End Set
    End Property

    Public Property TextRectangle As Rectangle
        Get
            Return m_TextRectangle
        End Get
        Set(value As Rectangle)
            m_TextRectangle = value
        End Set
    End Property

    Public Property TextFont As Font
        Get
            Return m_TextFont
        End Get
        Set(value As Font)
            m_TextFont = value
        End Set
    End Property

#End Region
End Class
